import axios from '@/libs/api.request.js'

export const searchTeachersByDepartment = data => {
    return axios.request({
        method:'get',
        data:null,
        url:`teacher/searchTeachersByDepartment/${data.id}`
    });
};

export const searchTeacherList = data => {
    return axios.request({
        method:'post',
        data:data,
        url:`teacher/searchTeacherList`
    });
};

export const saveTeacher = data => {
    return axios.request({
        method:'post',
        data:data,
        url:`teacher/saveTeacher`
    });
};

export const updateTeacher = data => {
    return axios.request({
        method:'post',
        data:data,
        url:`teacher/updateTeacher`
    });
};

export const saveOrUpdateTeacher = data => {
    return data.id ? updateTeacher(data) : saveTeacher(data);
};

export const searchTeacher = data => {
    return axios.request({
        method:'post',
        data:data,
        url:`teacher/searchTeacher`
    });
};

export const searchTeacherBySelf = () => {
    return axios.request({
        method:'get',
        data:null,
        url:'teacher/searchTeacherBySelf'
    });
};

export const searchTeachers = () => {
    return axios.request({
        method:'get',
        data:null,
        url:'teacher/searchTeachers'
    });
};